
** SINGLE PARTY GOVERNMENTS DAYS AFTER CABINET FORMATION

clear all
cd "${data}"	
use "data1.dta", clear

gen cabinetformation_single_in = daysaftercabinetformation if singleparty==1 

eststo ingovernment: mixed c.IMD3007_ c.daysaftercabinetformation##c.IMD5012_ if singleparty==1 &  daysaftercabinetformation>=0 & daysaftercabinetformation!=. || election_: daysaftercabinetformation

margins, dydx(IMD5012_) at(daysaftercabinetformation=(0(30)270))  post // among single party government in a single party government-produced election
marginsplot, plot1opts(color() lpattern(shortdash) lcolor(gs12)) recast(line) recastci(rarea) level(95) yline(0, lpattern(solid)) ci1opts(color(gs10*.8%50)) addplot(hist cabinetformation_single_in, percent color(gs5%20) yaxis(2) ytitle("percent", size(3.5) axis(2)) yscale(range(0(5)25) axis(2) alt)) legend(off) ytitle("AME of a one-unit change in expert party position", size(3.5)) title("") xscale(range(-100(100)300)) xlabel(-100(100)300) xline(0,  lpattern("-.") lcolor(black)) 
cd "${figures}"	
graph save "figureB1.gph", replace
graph export "figureB1.png", replace


cd "${tables}"	

esttab ingovernment using tableB1.tex, replace ///
b(3) se(3) nogap transform(ln*: exp(2*@) 2*exp(2*@)) label mlabels ("Model 1")
